package com.aj.http.request;

import java.util.HashMap;

import android.content.Context;
import android.util.Log;

import com.aj.http.AsynchronizationHttpRequest;
import com.aj.http.AsynchronizationHttpRequest.IHttpCallBack;

public class ManageBabyRequest extends BaseRequset {

	private static final String TAG = ManageBabyRequest.class.getName();

	public void excute(Context context, String userId, String oper,
			String babyId, String nickName, String conceptionDate,
			String bornDate, String photo, IHttpCallBack httpCallBack) {
		// 1：添加 2：修改 3：删除

		HashMap<String, String> paramsHashMap = new HashMap<String, String>();
		paramsHashMap.put("userId", userId);
		paramsHashMap.put("oper", oper);
		if (babyId != null) {
			paramsHashMap.put("babyId", babyId);
		}
		if (nickName != null) {
			paramsHashMap.put("nickName", nickName);
		}
		if (conceptionDate != null) {
			paramsHashMap.put("conceptionDate", conceptionDate);
		}
		if (bornDate != null) {
			paramsHashMap.put("bornDate", bornDate);
		}
		if (photo != null) {
			paramsHashMap.put("photo", photo);
		}
		String tempString = getParams(SERVICE_ADD_PHOTO_STRING, paramsHashMap);
		Log.e(TAG, "tempString:" + tempString);
		// TODO加密
		AsynchronizationHttpRequest request = new AsynchronizationHttpRequest();
		request.excute(context, BASE_REQUEST_URL_NOPAGE_STRING, tempString,
				httpCallBack);
	}
}
